function tdoa = readtdoa(filename, seui, neui, teui)
    csvdata = readtable(filename, 'ReadRowNames',false,'VariableNamingRule','preserve',"TextType","string", "Delimiter", ",", 'Format','%s%f%s%f%s%f%f%f%f%f%f%f');
    S = table2struct(csvdata, "ToScalar",true);
    rxeui = S.rxeui;
    txeui = S.txeui;
    filtereui = rxeui == seui & txeui == teui;
    seqs = S.seq(filtereui);
    toas = S.toa(filtereui);
    filtereui = rxeui == neui & txeui == teui;
    seqn = S.seq(filtereui);
    toan = S.toa(filtereui);

    i = 1;
    j = 1;
    tdoa = zeros(size(seqs, 1), 2);
    row = 0;
    while i <= size(seqs, 1)
        while j <= size(seqn, 1)
            if seqn(j) >= seqs(i)
                break;
            end
            j = j + 1;
        end
        if j <= size(seqn, 1)
            if seqs(i) < seqn(j)
                i = i + 1;
            else
                row = row + 1;
                tdoa(row, 1) = seqs(i);
                tdoa(row, 2) = toas(i) - toan(j);
                i = i + 1;
                j = j + 1;
            end
        end
    end
    tdoa = tdoa(1: row, :);
end